#include <stdio.h>

int is_leap(int year) {
    return (year % 4 == 0 && year % 100 != 0) ||
           (year % 400 == 0);
}

int a[13] = {
    0, 31, 28, 31, 30, 31, 30,
    31, 31, 30, 31, 30, 31
};

int main() {
    int b, c, d;
    scanf("%d-%d-%d", &b, &c, &d);

    int md[13];
    for (int i = 1; i <= 12; i++) {
        md[i] = a[i];
    }
    if (is_leap(b)) {
        md[2] = 29;
    }
    int dd = md[c] - d + 1;

    for (int m = c + 1; m <= 12; m++) {
        dd += md[m];
    }

    printf("还有%d天到新年", dd);
    return 0;
}
